import { Component } from '@angular/core';
import { SrmOrientation } from 'src/components/scenarios/enums';
import { SrmConfig } from 'src/components/scenarios/models';
import { SrmNode } from 'src/components/scenarios/nodes/SrmNode';
import { InfoSidebar } from '../../InfoSidebar';

@Component({
  selector: 'app-srm-info',
  templateUrl: './srm-info.component.html',
  styleUrl: './srm-info.component.scss'
})
export class SrmInfoComponent implements InfoSidebar {
  orientations: SrmOrientation[] = Object.values(SrmOrientation);
  sidebarRightVisible: boolean = false;
  cfg?: SrmConfig;

  item?: SrmNode;

  get status() {
    return this.item?.data.Values?.Status;
  }

  onShow(cfg: SrmConfig, srm: SrmNode) {
    this.cfg = cfg;
    this.item = srm;
    this.sidebarRightVisible = true;
  }

  onSidebarHide() {
    this.sidebarRightVisible = false;
    this.cfg = undefined;
    this.item;
  }
}


